<?php

namespace App\Http\Controllers\Merchant;

use App\Http\Response;
use App\Wallet;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class WalletController extends Controller
{
    use Response;
    public function index()
    {

    }
    public function used(Request $request)
    {
       $mch_id=auth('merchant')->id();
        $paginate=Wallet::with(['order'=>function($query){
            $query->with('detail');
        }])->where([['mch_id','=',$mch_id],['source','=',Wallet::Source_Order]])->paginate($request->get('pageSize'),'*','pageNo');
        return $this->success(200,$paginate);
    }
}
